home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 6: Level 6 / 17 Bit - Level 6 (1998)(Epic Marketing)[!].iso / quartz / q0398.dms / q0398.adf / DonsGenies / Don'sGenies / BoxToFront.pprx < prev    next >
Text File  |  1992-07-26  |  2KB  |  80 lines

  1. /* Box to Front
  2. Select a box by name or number and bring it to the front. Useful in complex layouts where there are several boxes on top of each other.
  3. Written by Don Cox */
  4.  
  5. trace n
  6. signal on error
  7. signal on syntax
  8. call ppm_AutoUpdate(0)
  9. cr = "0a"x
  10.  
  11. address command
  12. call SafeEndEdit.rexx()
  13.  
  14. call ppm_ShowStatus("Making List of Boxes ...")
  15. thispage = ppm_CurrentPage()
  16. totalboxes = ppm_NumBoxes(thispage)
  17. list = ""
  18. box = ppm_PageFirstBox(thispage)
  19. do i = 1 to totalboxes
  20.     number = right(ppm_BoxNum(box),4," ")    
  21.     info = ppm_GetBoxInfo(box)
  22.     boxtype = word(info,1)
  23.     boxname = ppm_GetBoxName(box)
  24.     select
  25.         when upper(boxtype) = "TEXT" then do
  26.             boxtext = ppm_GetBoxText(box,0)
  27.             shorttext = substr(boxtext,1,15)
  28.             if boxname = "" then boxname = shorttext
  29.             end
  30.         when upper(boxtype) = "BITMAP" then do
  31.             filename = word(info,5)
  32.             filename = substr(filename, lastpos("/",filename)+1)
  33.             if boxname = "" then boxname = filename
  34.             end
  35.         when upper(boxtype) = "EPSF" then do
  36.             filename = word(info,3)
  37.             filename = substr(filename, lastpos("/",filename)+1)
  38.             if boxname = "" then boxname = filename
  39.             end
  40.         when upper(boxtype) = "CLIP" then do
  41.             objects = "Clip, "||word(info,2)||" objects"
  42.             if boxname = "" then boxname = objects
  43.             end
  44.         when upper(boxtype) = "STRUCTURED" then do
  45.             objects = "Struct., "||word(info,2)||" objects"
  46.             if word(info,2)=1 then objects = "Struct., 1 object"
  47.             if boxname = "" then boxname = objects
  48.             end
  49.         when upper(boxtype) = "EMPTY" then do
  50.            if boxname = "" then boxname = "Empty"
  51.            end
  52.         otherwise boxname = "Unknown type of box"
  53.     end
  54.     boxtype = substr(boxtype,1,1)
  55.     list = list||number" "boxtype" "boxname||cr
  56.     box = ppm_PageNextBox(box)
  57.     end
  58.  
  59. call ppm_ClearStatus()
  60. chosen = ppm_SelectFromList("Select Box...",35,18,0,list)
  61. box = ppm_SelectBox(word(chosen,1))
  62. call ppm_BoxToFront(box)
  63. exit_msg()
  64.  
  65. error:
  66. syntax:
  67.     do
  68.     exit_msg("Genie failed due to error: "errortext(rc))
  69.     end
  70.  
  71. exit_msg:
  72.     do
  73.     parse arg message
  74.     if message ~= "" then
  75.     call ppm_Inform(1,message)
  76.     call ppm_ClearStatus()
  77.     call ppm_AutoUpdate(1)
  78.     exit
  79.     end
  80.